﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace The_Last_Knights.GUI
{
    public class PictureBox: NormalButton
    {
        protected Texture2D _Source;

        public Texture2D Source
        {
            get { return _Source; }
            set { _Source = value; }
        }

        public PictureBox(Game game, string ID, Vector2 pos, Vector2 size, Texture2D background) 
            : base(game, null, null, null, null, ID, pos, size, background)
        {

        }

        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
            if (_Source != null)
            {
                SpriteBatch sb = GetSpriteBatch();
                if (sb != null)
                {
                    sb.Begin();
                    sb.Draw(_Source, GetBoundary(), Color.White);
                    sb.End();
                }
            }
        }
    }
}
